/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hu.bme.j2ee.v37zen.beans.util;

import hu.bme.j2ee.v37zen.beans.FindUsersBean;
import hu.bme.j2ee.v37zen.entities.User;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Kiss Dániel
 */
@Stateless
@LocalBean
public class CleanupBean {

    @PersistenceContext
    EntityManager em;
    @EJB
    FindUsersBean fub;
    
    public void removeAllUser(){
        
        List<User> users = fub.findAllUser();
        for (User user : users) {
            em.remove(user);
        }
    }
    
}
